<template>
	<icon :class="classes">
		<slot></slot>
	</icon>
</template>

<script>
	import Icon from '../widget/Icon.vue';
	export default {
		name: 'FoldIcon',
		components: {Icon},
		props: {
			open: {type: Boolean, default: false},
			icon: {type: String, default: 'fa-caret-up'}
		},
		computed: {
			classes () {
				return {
					[`${this.icon} rotate-360`]: this.open,
					[`${this.icon} rotate-180`]: !this.open
				};
			}
		}
	};
</script>
